import axios from 'axios'
import store from '@/store'

const request = axios.create({
  baseURL: 'http://liufusong.top:8080',
  timeout: 3000
})

// 请求头添加token
request.interceptors.request.use((config) => {
  if (store.state.user) {
    config.headers.Authorization = store.state.user
  }
  return config
})
export default request
